load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "upgrademanager",
    srcs = ["manager.go"],
    importpath = "github.com/cockroachdb/cockroach/pkg/upgrade/upgrademanager",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/clusterversion",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/roachpb",
        "//pkg/security/username",
        "//pkg/server/serverpb",
        "//pkg/server/settingswatcher",
        "//pkg/settings/cluster",
        "//pkg/sql",
        "//pkg/sql/catalog/lease",
        "//pkg/sql/isql",
        "//pkg/sql/protoreflect",
        "//pkg/sql/sem/tree",
        "//pkg/upgrade",
        "//pkg/upgrade/migrationstable",
        "//pkg/upgrade/upgradebase",
        "//pkg/upgrade/upgradecluster",
        "//pkg/upgrade/upgradejob:upgrade_job",
        "//pkg/upgrade/upgrades",
        "//pkg/util/buildutil",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "//pkg/util/retry",
        "//pkg/util/startup",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "upgrademanager_test",
    size = "medium",
    srcs = [
        "main_test.go",
        "manager_external_test.go",
    ],
    deps = [
        ":upgrademanager",
        "//pkg/base",
        "//pkg/ccl/kvccl/kvtenantccl",
        "//pkg/clusterversion",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/kv",
        "//pkg/kv/kvserver/batcheval",
        "//pkg/kv/kvserver/liveness",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/server/settingswatcher",
        "//pkg/settings/cluster",
        "//pkg/sql/execinfra",
        "//pkg/sql/isql",
        "//pkg/sql/protoreflect",
        "//pkg/sql/sem/eval",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/upgrade",
        "//pkg/upgrade/upgradebase",
        "//pkg/upgrade/upgrades",
        "//pkg/util",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/tracing",
        "//pkg/util/tracing/tracingpb",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
        "@org_golang_x_sync//errgroup",
    ],
)
